package th.go.drr.gps.services;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import th.go.drr.gps.domain.Province;
import th.go.drr.gps.repository.cache.h.AmphurCacheHandler;
import th.go.drr.gps.repository.cache.h.ProvinceCacheHandler;
import th.go.drr.gps.web.model.ProvinceList;

@Controller
@RequestMapping("/amphur")
public class AmphurRestClient {

	private static Logger logger = Logger.getLogger(AmphurRestClient.class);
	
	private AmphurCacheHandler amphurCache;

	@RequestMapping(method=RequestMethod.GET, value="/{id}", headers="Accept=application/json,application/xml",produces = "application/json;charset=utf-8")
	@ResponseBody public Province  findProvinceByName(@PathVariable Integer id) {
			logger.info(id);
			return null;//addressCache.findProvinceById(id);
	}
	
	@RequestMapping(method=RequestMethod.GET, value="/all", headers="Accept=application/json,application/xml",produces = "application/json;charset=utf-8")
	@ResponseBody public ProvinceList  getAll() {		
		return null;//new ProvinceList(this.addressCache.findAllProvince());
	}

	public void setAmphurCache(AmphurCacheHandler amphurCache) {
		this.amphurCache = amphurCache;
	}
}
